Disable workDoneProgress if defcustom is nil
authorTheodor Thornhill <theo@thornhill.no>
Sat, 30 Mar 2024 08:35:16 +0000 (09:35 +0100)
committerTheodor Thornhill <theo@thornhill.no>
Sat, 30 Mar 2024 19:48:32 +0000 (20:48 +0100)
There is no need to receive the $/progress notifications from the server
if we don't want to render them. Because they are effectively ignored
when eglot-report-progress is nil we'd rather not waste cycles on serde
of the messages.

* lisp/progmodes/eglot.el (eglot-client-capabilities): use value from
defcustom to decide whether or not to advertise to server.

lisp/progmodes/eglot.el

index 515c33f8cdeafc2594e8f9152f7b0757961dac35..f247c43203cb13ce49010dd135b4d0e5a6d14552 100644 (file)
@@ -1004,7 +1004,7 @@ ACTION is an LSP object of either `CodeAction' or `Command' type."
                                          [,@(mapcar
                                              #'car eglot--tag-faces)])))
             :window `(:showDocument (:support t)
-                      :workDoneProgress t)
+                      :workDoneProgress ,(if eglot-report-progress t :json-false))
             :general (list :positionEncodings ["utf-32" "utf-8" "utf-16"])
             :experimental eglot--{})))